package Homework;
import java.util.Scanner;
//定义三个无参数，无返回值的方法，分别实现三角形,正方形，长方形的面积
public class test23 {
    public static void main(String[] args) {
        getSJXarea();
        getZFXarea();
        getCFXarea();
    }
        public static void getSJXarea () {
        Scanner SC =new Scanner(System.in);
      System.out.println("请输入三角形的底：");
      double a = SC.nextDouble();
      System.out.println("请输入三角形的高：");
      double b =SC.nextDouble();
      System.out.println("三角形的面积为：" + (a*b*0.50));
    }
    public static void getZFXarea (){
        Scanner SC =new Scanner(System.in);
        System.out.println("请输入正方形的的高：");
        double a =SC.nextDouble();
        System.out.println("请输入正方形的底：");
        double b =SC.nextDouble();
        System.out.println("正方形的面积为：" + (a*b));
    }
    public static void getCFXarea(){
        Scanner SC =new Scanner(System.in);
        System.out.println("请输入长方形的高：" );
        double a =SC.nextDouble();
        System.out.println("请输入长方形的底：");
        double b =SC.nextDouble();
        System.out.println("长方形的面积为；"+(a*b));
    }
}


